package ve.ejb.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author memozac
 */
@Entity
public class Panel implements Serializable {
    private static final long serialVersionUID = 1L;

    public enum Position{TOP_LEFT,TOP_RIGHT,BOT_LEFT,BOT_RIGHT};
    public enum Size{_1,_2};
    public enum Type{NOTE,PROYECT,SCORECARD,POINTER,RESPONSIBLE};

    @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long idPanel;

    @OneToOne private Notification notification;

    @ManyToOne private ScoreCard scoreCard;

    @ManyToOne private Person person;

    @Enumerated private Position position;

    @Enumerated private Type type;

    @Enumerated private Size panelSize;

    @Temporal(value = TemporalType.TIMESTAMP) private Date registerDate;

    public Date getRegisterDate() {
        return registerDate;
    }

    public void setRegisterDate(Date registerDate) {
        this.registerDate = registerDate;
    }
    
    public Type getType() {
        return type;
    }

    public void setType(Type type) {
        this.type = type;
    }

    public Size getPanelSize() {
        return panelSize;
    }

    public void setPanelSize(Size panelSize) {
        this.panelSize = panelSize;
    }

    public Position getPosition() {
        return position;
    }

    public void setPosition(Position position) {
        this.position = position;
    }

    public Person getPerson() {
        return person;
    }

    public void setPerson(Person person) {
        this.person = person;
    }

    public Long getIdPanel() {
        return idPanel;
    }

    public void setIdPanel(Long idPanel) {
        this.idPanel = idPanel;
    }

    public Notification getNotification() {
        return notification;
    }

    public void setNotification(Notification notification) {
        this.notification = notification;
    }

    public ScoreCard getScoreCard() {
        return scoreCard;
    }

    public void setScoreCard(ScoreCard scoreCard) {
        this.scoreCard = scoreCard;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPanel != null ? idPanel.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof Panel)) {
            return false;
        }
        Panel other = (Panel) object;
        if ((this.idPanel == null && other.idPanel != null) || (this.idPanel != null && !this.idPanel.equals(other.idPanel))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ve.ejb.entity.Panel[id=" + idPanel + "]";
    }

}//ends of class
